//
//  UIImage+CNLSExtension.h
//  CNLSAPP
//
//  Created by frank on 2018/7/31.
//  Copyright © 2018年 CNLSAPP. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, GradientDirection) {
    GradientDirectionTopToBottom = 0,    // 从上往下 渐变
    GradientDirectionLeftToRight,        // 从左往右
    GradientDirectionBottomToTop,      // 从下往上
    GradientDirectionRightToLeft      // 从右往左
};

@interface UIImage (CNLSExtension)
+ (UIImage *)fetchImage:(NSString *)imageNameOrPath;

+ (UIImage *)fetchChartlet:(NSString *)imageName chartletId:(NSString *)chartletId;

- (UIImage *)imageForAvatarUpload;

+ (CGSize)hl_sizeWithImageOriginSize:(CGSize)originSize minSize:(CGSize)imageMinSize maxSize:(CGSize)imageMaxSize;

/** UIColor 转UIImage */
+ (UIImage *)imageWithColor:(UIColor *)color;

// UIColor 转UIImage
+ (UIImage *)imageWithColor:(UIColor *)color rect:(CGRect)recA;
// UIColor 转UIImage  isCircular 是否为圆形
+ (UIImage *)imageWithColor:(UIColor *)color rect:(CGRect)recA isCircular:(BOOL)isCircular;

+ (UIImage*)gradientImageWithBounds:(CGRect)bounds andColors:(NSArray*)colors andGradientType:(GradientDirection)gradientType;

@end
